<%--
  Created by IntelliJ IDEA.
  User: Vincent
  Date: 2015/1/4
  Time: 13:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>

<form id="menu_add_form" method="post"
      action="${pageContext.request.contextPath}/admin/menu/update.html">
    <input type="hidden" name="menuId" value="${requestScope.menu.id}" />
    <div style="width: 350px;margin: 15px;">
        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="50"
               placeholder="菜单名 " value="${requestScope.menu.name}"
               name="name"
               datatype="menuname"
               nullmsg="菜单名不能为空"
               errormsg="菜单名格式错误"/>
        </span>
        <p class="form_prompt">菜单名由英文字母、汉字和数字组成</p>

        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="100"
               placeholder="菜单链接 " value="${requestScope.menu.url}"
               name="url"
            />
        </span>
        <p class="form_prompt">菜单链接不能超过100个字符</p>

        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="2"
               placeholder="菜单排序 " value="${requestScope.menu.order}"
               name="order"
               datatype="n"
               nullmsg="菜单排序不能为空"
               errormsg="菜单排序格式错误">
        </span>
        <p class="form_prompt">菜单排序只能为数字</p>

        <span class="block input-icon input-icon-right">
        <input type="text" class="form-control" maxlength="100"
               placeholder="菜单图标 "
              value="${requestScope.menu.icon}"
               name="icon"
               />
        </span>
        <p class="form_prompt">菜单图标不能超过100个字符</p>

        <div>
            <button type="submit" class="btn btn-sm btn-primary"><i class="icon-save align-top bigger-125"></i>保存
            </button>
            <a href="${pageContext.request.contextPath}/menu/manage.html" class="btn btn-sm btn-grey"><i
                    class="icon-reply align-top bigger-125"></i>返回</a>
        </div>
    </div>
</form>
<script>
    top.setMenuActionOpen('系统设置', '菜单管理', '编辑菜单');
    $('#menu_add_form').Validform({
        btnSubmit: "#menu_add_form button[type=submit]",
        showAllError: false,
        postonce: true,
        ajaxPost: false,
        tiptype: function (msg, o, cssctl) {
            if (!o.obj.is("form")) {
                var objtip = o.obj.parent().next(".form_prompt");
                cssctl(objtip, o.type);
                objtip.text(msg);
            }
        },
        beforeSubmit: function (curform) {
            return true;
        }
    });
</script>
</body>
</html>
